A database is a collection of stored data that is logically related and that is accessible by one or more users or applications. A popular type of database is the relational database management system (RDBMS), which includes relational tables, also referred to as relations, made up of rows and columns (also referred to as tuples and attributes). Each row represents an occurrence of an entity defined by a table, with an entity being a person, place, thing, or other object about which the table contains information.
One of the goals of a database management system is to optimize the performance of queries for access and manipulation of data stored in the database. Given a target environment, an optimal query plan is selected, with the optimal query plan being the one with the lowest cost (e.g., response time) as determined by an optimizer. The response time is the amount of time it takes to complete the execution of a query on a given system.
Database architects utilize extensibility features to add functionality to the database and to move more analytical processing inside of the database for better control and performance. Mechanisms for achieving these goals include User Defined Functions (UDFs) and User Defined Methods (UDM) and types. However, contemporary database systems do not assign a true cost to the execution of a user defined function or user defined method. Disadvantageously, the time estimates for running an SQL command often do not accurately reflect the time or resources necessary to execute operations that involve UDFs or UDMs.